﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Diagnostics;

namespace SimpleShell.Views
{
    public partial class Home : UserControl, nRoute.Navigation.ISupportNavigationViewLifecycle
    {
        public Home()
        {
            InitializeComponent();
        }

        public void Initialize(nRoute.Navigation.NavigationResponse response)
        {
            ((Storyboard)this.Resources["InitializeStoryboard"]).Begin();            
        }

        public void Closing(nRoute.Navigation.NavigationRequest request, Action closeCallback)
        {
            var _storyboard = (Storyboard)this.Resources["CloseStoryboard"];
            _storyboard.Completed += (s, e) => closeCallback();
            _storyboard.Begin();
        }
    }
}
